﻿/*****************************************************************************
 
 Use of Ext is under the Ext JS license, for more information, 
 please visit http://extjs.com/products/license.php page. 
  
 You should confirm that you have read, understood and accept ethical criteria listed. 
 If not, see <http://www.mvcnext.com/license/>.
  
 Version: 1.0.0.0
 Website: http://www.mvcnext.com/
 
 Copyright (c) Yoganand R. All rights reserved.
 For continued development and updates, visit http://yogsbreath.net
 
 ******************************************************************************/

using System;
using System.Collections.Generic;
using System.Web.UI;


namespace MVCnExt.Web.UI.Ext
{
    public class ExtSplitButton : ExtButton
    {
        public override IList<ScriptDescriptor> GetScriptDescriptors()
        {
            IList<ScriptDescriptor> list = base.GetScriptDescriptors();

            ScriptControlDescriptorBase desc = (ScriptControlDescriptorBase)list[0];

            desc.Type = "Ext.SplitButton";

            if (!String.IsNullOrEmpty("arrowHandler"))
                desc.AddPropertyBase("arrowHandler", String.Format("'{0}'", arrowHandler));

            if (!String.IsNullOrEmpty("arrowTooltip"))
                desc.AddPropertyBase("arrowTooltip", String.Format("'{0}'", arrowTooltip));

            return list;
        }

        #region PublicProperties

        public String arrowHandler { get; set; }

        public String arrowTooltip { get; set; }

        #endregion
    }
}
